<template>
  <el-card style="max-width: 480px" shadow="hover" @click="goDetail">
    <div class="content">
      <div class="left">
        <div class="hospital_name">
          {{ hospitalInfo.hosname }}
        </div>
        <div class="tip">
          <div class="level">
            <svg t="1739248621543" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
              p-id="6633" width="16" height="16">
              <path
                d="M857.28 344.992H592.448c12.576-44.256 18.944-83.584 18.944-118.208 0-78.56-71.808-153.792-140.544-143.808-60.608 8.8-89.536 59.904-89.536 125.536v59.296c0 76.064-58.208 140.928-132.224 148.064l-117.728-0.192A67.36 67.36 0 0 0 64 483.04V872c0 37.216 30.144 67.36 67.36 67.36h652.192a102.72 102.72 0 0 0 100.928-83.584l73.728-388.96A102.72 102.72 0 0 0 857.28 344.992zM128 872V483.04a3.36 3.36 0 0 1 3.36-3.36H208v395.68h-76.64A3.36 3.36 0 0 1 128 872z m767.328-417.088L821.6 843.872a38.72 38.72 0 0 1-38.048 31.488H272V476.864a213.312 213.312 0 0 0 173.312-209.088v-59.264c0-37.568 12.064-58.912 34.72-62.176 27.04-3.936 67.36 38.336 67.36 80.48 0 37.312-9.504 84-28.864 139.712a32 32 0 0 0 30.24 42.496H857.28a38.72 38.72 0 0 1 38.048 45.888z"
                p-id="6634"></path>
            </svg>
            <span>{{ hospitalInfo.param.hostypeString }}</span>
          </div>
          <div class="time">
            <svg t="1739248743702" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
              p-id="8829" width="16" height="16">
              <path
                d="M513.140474 159.430946c-193.100757 0-351.07861 157.977853-351.07861 351.074516 0 193.051638 157.977853 351.025398 351.07861 351.025398 193.100757 0 351.074516-157.97376 351.074516-351.025398C864.21499 317.408799 706.24123 159.430946 513.140474 159.430946zM513.140474 791.339289c-154.480196 0-280.829733-126.402749-280.829733-280.833826 0-154.476103 126.349537-280.877828 280.829733-280.877828 154.425961 0 280.829733 126.401725 280.829733 280.877828C793.970206 664.935517 667.566434 791.339289 513.140474 791.339289z"
                fill="#231815" p-id="8830"></path>
              <path
                d="M530.676854 334.94211 478.01757 334.94211 478.01757 545.579248 660.57419 657.890061 688.651638 612.326374 530.676854 517.49873Z"
                fill="#231815" p-id="8831"></path>
            </svg>
            <span>每天{{ hospitalInfo.bookingRule?.releaseTime }}放号</span>
          </div>
        </div>
      </div>
      <div class="right">
        <img :src="`data:image/jpeg;base64,${hospitalInfo.logoData}`" alt="">
      </div>
    </div>
  </el-card>
</template>

<script setup lang=ts>
//引入路由器
import { useRouter } from 'vue-router';

//创建路由器对象
let $router = useRouter()
//声明props：接收父组件传递过来的医院数据
const props = defineProps(['hospitalInfo'])


//点击医院卡片的时候跳转到医院的详情页面
const goDetail = () => {
  $router.push({
    path: '/hospital/register',
    query: {
      hoscode: props.hospitalInfo.hascode
    }
  })
}
</script>

<style scoped lang="scss">
.content {
  display: flex;
  justify-content: space-between;

  .left {
    width: 60%;

    .tip {
      color: #7f7f7f;
      margin-top: 20px;
      display: flex;
      justify-content: space-between;

      .level {
        display: flex;
        align-items: center;

        span {
          margin-left: 5px;
        }
      }

      .time {
        display: flex;
        align-items: center;

        span {
          margin-left: 5px;
        }
      }
    }
  }

  .right {

    img {
      width: 50px;
      height: 50px;
    }
  }
}
</style>